package com.ruoyi.order.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.goodsDetail.domain.OrderGoodsDetail;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 订单信息对象 wdm_order
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Data
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    private Long orderId;

    /** 订单号 */
    @Excel(name = "订单号")
    private String orderCode;

    /** 顾客ID */
    @Excel(name = "顾客ID")
    private Long guestId;

    /** 订单类型 */
    @Excel(name = "订单类型")
    private String orderType;

    /** 总计金额 */
    @Excel(name = "总计金额")
    private BigDecimal totalAmount;

    /** 主状态 */
    @Excel(name = "主状态")
    private String masterStatus;

    /** 支付时间 */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timezone = "GMT+8")
    private Date payTime;


    /** 处理时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "处理时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date processTime;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date finishTime;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 删除标志 */
    private String delFlag;

    /** 版本号 */
    private Long version;

    /** 扩展数据 */
    @Excel(name = "扩展数据")
    private String orderExtra;

    /** 用户ID */
    private Long userId;

    /** 超时时间 */
    @Excel(name = "超时时间")
    private Date expireTime;

    /** 商品详情列表 */
    private OrderGoodsDetail goodsDetails;

    /** 分销员ID */
    private Long distributorId;

    /** 核销码 */
    @Excel(name = "核销码")
    private String verificationCode;

    /** 核销状态（0待使用 1已使用） */
    @Excel(name = "核销状态", readConverterExp = "0=待使用,1=已使用")
    private String verificationStatus;

    /** 核销时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date verificationTime;

    /** 是否赠品 */
    private String isGifted;

    /** 赠品用户ID */
    private Long giftedUserId;

    /** 二维码图片地址 */
    @Excel(name = "二维码图片地址")
    private String qrCodeUrl;

    /** 二维码图片数据（Base64编码） */
    @Excel(name = "二维码图片数据")
    private String qrCodeData;

    /** 场景ID */
    private String sceneId;

    public String getVerificationStatus() {
        return verificationStatus;
    }

    public void setVerificationStatus(String verificationStatus) {
        this.verificationStatus = verificationStatus;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public Date getVerificationTime() {
        return verificationTime;
    }

    public void setVerificationTime(Date verificationTime) {
        this.verificationTime = verificationTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("orderCode", getOrderCode())
            .append("guestId", getGuestId())
            .append("orderType", getOrderType())
            .append("totalAmount", getTotalAmount())
            .append("masterStatus", getMasterStatus())
            .append("createTime", getCreateTime())
            .append("payTime", getPayTime())
            .append("processTime", getProcessTime())
            .append("finishTime", getFinishTime())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("version", getVersion())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("orderExtra", getOrderExtra())
            .append("userId", getUserId())
            .append("expireTime", getExpireTime())
            .append("distributorId", getDistributorId())
            .append("verificationCode", getVerificationCode())
            .append("verificationStatus", getVerificationStatus())
            .append("verificationTime", getVerificationTime())
            .append("isGifted", getIsGifted())
            .append("giftedUserId", getGiftedUserId())
            .toString();
    }
}
